package com.hh.front.controller;

import com.hh.common.response.CommonResult;
import com.hh.common.response.LogisticsQueryResponse;
import com.hh.service.service.LogisticService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController()
@RequestMapping("api/front/order/logistics")
public class LogisticsController {

    @Autowired
    private LogisticService logisticService;
    /**
     * 实时快递查询
     *
     * @param orderNo
     * @param deliveryId
     * @return
     */
    @RequestMapping(value = "/query", method = RequestMethod.GET)
    public CommonResult<LogisticsQueryResponse> logisticsQuery(@RequestParam(value = "orderType") Integer orderType,@RequestParam(value = "orderNo") String orderNo, @RequestParam("deliveryId") String deliveryId) {
        LogisticsQueryResponse logisticsQueryResponse = this.logisticService.logisticsQuery(orderType,orderNo, deliveryId);

        return CommonResult.success(logisticsQueryResponse);

    }
}
